from django.db import models


# Create your models here.


class Direction(models.Model):
    """
    学习课程方向表
    """
    direction_name = models.CharField(max_length=255, verbose_name="课程方向")

    def __str__(self):
        return self.direction_name


class DirectionCourse(models.Model):
    """
    各个方向课程名称表
    """
    course_name = models.CharField(max_length=255, verbose_name="课程名称")
    direction = models.ForeignKey(Direction, on_delete=models.CASCADE, verbose_name="课程所属方向",
                                  related_name='direction_course')

    def __str__(self):
        return self.course_name
